package com.gitee.zycra.future.job.common.enums;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author zycra
 */
public enum UserAuthEnum implements CommonEnum<UserAuthEnum> {

    /**
     * 用户权限
     */
    ADMIN(0, "管理员"),
    R(4, "读"),
    RX(5, "读+执行"),
    RW(6, "读+写"),
    RWX(7, "读+写+执行");

    private static final Map<Integer, String> DIRECT_MAP = new LinkedHashMap<>();

    static {
        for (UserAuthEnum value : UserAuthEnum.values()) {
            DIRECT_MAP.put(value.getCode(), value.getDesc());
        }
    }

    /**
     * 枚举值
     */
    private final Integer code;

    /**
     * 枚举描述
     */
    private final String desc;

    UserAuthEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static Map<Integer, String> getMap() {
        return DIRECT_MAP;
    }
}
